package com.china.school.controller;

import com.china.school.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AnnTestController {

    @GetMapping("/header")
    public User header(@RequestHeader User user){
        return user;
    }
    @GetMapping("/header2")
    public User header2(@RequestHeader(name = "name") String name ,@RequestHeader(name = "age") int age){
        return new User(name,age);
    }

}
